﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 盘点单表基础输入参数
/// </summary>
public class SysstocktakingorderBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }

    /// <summary>
    /// 盘点单号
    /// </summary>
    [Required(ErrorMessage = "盘点单号不能为空")]
    public virtual string Code { get; set; }

    /// <summary>
    /// 盘点结果
    /// </summary>
    public virtual string? InventoryResult { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public virtual string? WarehouseName { get; set; }

    /// <summary>
    /// 盘点类型
    /// </summary>
    public virtual string? StockTakingType { get; set; }

    /// <summary>
    /// 盘点开始时间
    /// </summary>
    public virtual DateTime? StartTime { get; set; }

    /// <summary>
    /// 盘点结束时间
    /// </summary>
    public virtual DateTime? EndTime { get; set; }

    /// <summary>
    /// 出库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "出库状态不能为空")]
    public virtual DocumentStatusEnum? OutStatus { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "入库状态不能为空")]
    public virtual DocumentStatusEnum? InStatus { get; set; }

    /// <summary>
    /// 盘点货品
    /// </summary>
    public virtual string? GoodsName { get; set; }

    /// <summary>
    /// 盘点数量
    /// </summary>
    public virtual int? Quantity { get; set; }

    /// <summary>
    /// 盘盈数量
    /// </summary>
    public virtual int? ProfitQuantity { get; set; }

    /// <summary>
    /// 盘亏数量
    /// </summary>
    public virtual int? LossQuantity { get; set; }

    /// <summary>
    /// 盘盈金额
    /// </summary>
    public virtual decimal? ProfitAmount { get; set; }

    /// <summary>
    /// 盘亏金额
    /// </summary>
    public virtual decimal? LossAmount { get; set; }

    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public virtual DocumentStatusEnum? DocumentStatus { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }

    /// <summary>
    /// 软删除时间
    /// </summary>
    public virtual DateTime? DeleteTime { get; set; }

}

/// <summary>
/// 盘点单表分页查询输入参数
/// </summary>
public class PageSysstocktakingorderInput : BasePageInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    public string Code { get; set; }

    /// <summary>
    /// 盘点结果
    /// </summary>
    public string? InventoryResult { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 盘点类型
    /// </summary>
    public string? StockTakingType { get; set; }

    /// <summary>
    /// 盘点开始时间范围
    /// </summary>
    public DateTime?[] StartTimeRange { get; set; }

    /// <summary>
    /// 盘点结束时间范围
    /// </summary>
    public DateTime?[] EndTimeRange { get; set; }

    /// <summary>
    /// 出库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    public DocumentStatusEnum? OutStatus { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    public DocumentStatusEnum? InStatus { get; set; }

    /// <summary>
    /// 盘点货品
    /// </summary>
    public string? GoodsName { get; set; }

    /// <summary>
    /// 盘点数量
    /// </summary>
    public int? Quantity { get; set; }

    /// <summary>
    /// 盘盈数量
    /// </summary>
    public int? ProfitQuantity { get; set; }

    /// <summary>
    /// 盘亏数量
    /// </summary>
    public int? LossQuantity { get; set; }

    /// <summary>
    /// 盘盈金额
    /// </summary>
    public decimal? ProfitAmount { get; set; }

    /// <summary>
    /// 盘亏金额
    /// </summary>
    public decimal? LossAmount { get; set; }

    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    public DocumentStatusEnum? DocumentStatus { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 软删除时间范围
    /// </summary>
    public DateTime?[] DeleteTimeRange { get; set; }

    /// <summary>
    /// 选中主键列表
    /// </summary>
    public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 盘点单表增加输入参数
/// </summary>
public class AddSysstocktakingorderInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    [Required(ErrorMessage = "盘点单号不能为空")]
    [MaxLength(64, ErrorMessage = "盘点单号字符长度不能超过64")]
    public string Code { get; set; }

    /// <summary>
    /// 盘点结果
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘点结果字符长度不能超过32")]
    public string? InventoryResult { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    [MaxLength(64, ErrorMessage = "仓库名称字符长度不能超过64")]
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 盘点类型
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘点类型字符长度不能超过32")]
    public string? StockTakingType { get; set; }

    /// <summary>
    /// 盘点开始时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 盘点结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 出库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "出库状态不能为空")]
    public DocumentStatusEnum? OutStatus { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "入库状态不能为空")]
    public DocumentStatusEnum? InStatus { get; set; }

    /// <summary>
    /// 盘点货品
    /// </summary>
    [MaxLength(512, ErrorMessage = "盘点货品字符长度不能超过512")]
    public string? GoodsName { get; set; }

    /// <summary>
    /// 盘点数量
    /// </summary>
    public int? Quantity { get; set; }

    /// <summary>
    /// 盘盈数量
    /// </summary>
    public int? ProfitQuantity { get; set; }

    /// <summary>
    /// 盘亏数量
    /// </summary>
    public int? LossQuantity { get; set; }

    /// <summary>
    /// 盘盈金额
    /// </summary>
    public decimal? ProfitAmount { get; set; }

    /// <summary>
    /// 盘亏金额
    /// </summary>
    public decimal? LossAmount { get; set; }

    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public DocumentStatusEnum? DocumentStatus { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }

    /// <summary>
    /// 软删除时间
    /// </summary>
    public DateTime? DeleteTime { get; set; }

}

/// <summary>
/// 盘点单表删除输入参数
/// </summary>
public class DeleteSysstocktakingorderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }

}

/// <summary>
/// 盘点单表更新输入参数
/// </summary>
public class UpdateSysstocktakingorderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }

    /// <summary>
    /// 盘点单号
    /// </summary>    
    [Required(ErrorMessage = "盘点单号不能为空")]
    [MaxLength(64, ErrorMessage = "盘点单号字符长度不能超过64")]
    public string Code { get; set; }

    /// <summary>
    /// 盘点结果
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘点结果字符长度不能超过32")]
    public string? InventoryResult { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>    
    [MaxLength(64, ErrorMessage = "仓库名称字符长度不能超过64")]
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 盘点类型
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘点类型字符长度不能超过32")]
    public string? StockTakingType { get; set; }

    /// <summary>
    /// 盘点开始时间
    /// </summary>    
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 盘点结束时间
    /// </summary>    
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 出库状态
    /// </summary>    
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "出库状态不能为空")]
    public DocumentStatusEnum? OutStatus { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>    
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "入库状态不能为空")]
    public DocumentStatusEnum? InStatus { get; set; }

    /// <summary>
    /// 盘点货品
    /// </summary>    
    [MaxLength(512, ErrorMessage = "盘点货品字符长度不能超过512")]
    public string? GoodsName { get; set; }

    /// <summary>
    /// 盘点数量
    /// </summary>    
    public int? Quantity { get; set; }

    /// <summary>
    /// 盘盈数量
    /// </summary>    
    public int? ProfitQuantity { get; set; }

    /// <summary>
    /// 盘亏数量
    /// </summary>    
    public int? LossQuantity { get; set; }

    /// <summary>
    /// 盘盈金额
    /// </summary>    
    public decimal? ProfitAmount { get; set; }

    /// <summary>
    /// 盘亏金额
    /// </summary>    
    public decimal? LossAmount { get; set; }

    /// <summary>
    /// 单据状态
    /// </summary>    
    [Dict(nameof(DocumentStatusEnum), AllowNullValue = true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public DocumentStatusEnum? DocumentStatus { get; set; }

    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }

    /// <summary>
    /// 软删除时间
    /// </summary>    
    public DateTime? DeleteTime { get; set; }

}

/// <summary>
/// 盘点单表主键查询输入参数
/// </summary>
public class QueryByIdSysstocktakingorderInput : DeleteSysstocktakingorderInput
{
}

/// <summary>
/// 盘点单表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportSysstocktakingorderInput : BaseImportInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    [ImporterHeader(Name = "*盘点单号")]
    [ExporterHeader("*盘点单号", Format = "", Width = 25, IsBold = true)]
    public string Code { get; set; }

    /// <summary>
    /// 盘点结果
    /// </summary>
    [ImporterHeader(Name = "盘点结果")]
    [ExporterHeader("盘点结果", Format = "", Width = 25, IsBold = true)]
    public string? InventoryResult { get; set; }

    /// <summary>
    /// 仓库名称
    /// </summary>
    [ImporterHeader(Name = "仓库名称")]
    [ExporterHeader("仓库名称", Format = "", Width = 25, IsBold = true)]
    public string? WarehouseName { get; set; }

    /// <summary>
    /// 盘点类型
    /// </summary>
    [ImporterHeader(Name = "盘点类型")]
    [ExporterHeader("盘点类型", Format = "", Width = 25, IsBold = true)]
    public string? StockTakingType { get; set; }

    /// <summary>
    /// 盘点开始时间
    /// </summary>
    [ImporterHeader(Name = "盘点开始时间")]
    [ExporterHeader("盘点开始时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 盘点结束时间
    /// </summary>
    [ImporterHeader(Name = "盘点结束时间")]
    [ExporterHeader("盘点结束时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 出库状态
    /// </summary>
    [ImporterHeader(Name = "*出库状态")]
    [ExporterHeader("*出库状态", Format = "", Width = 25, IsBold = true)]
    public DocumentStatusEnum? OutStatus { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    [ImporterHeader(Name = "*入库状态")]
    [ExporterHeader("*入库状态", Format = "", Width = 25, IsBold = true)]
    public DocumentStatusEnum? InStatus { get; set; }

    /// <summary>
    /// 盘点货品
    /// </summary>
    [ImporterHeader(Name = "盘点货品")]
    [ExporterHeader("盘点货品", Format = "", Width = 25, IsBold = true)]
    public string? GoodsName { get; set; }

    /// <summary>
    /// 盘点数量
    /// </summary>
    [ImporterHeader(Name = "盘点数量")]
    [ExporterHeader("盘点数量", Format = "", Width = 25, IsBold = true)]
    public int? Quantity { get; set; }

    /// <summary>
    /// 盘盈数量
    /// </summary>
    [ImporterHeader(Name = "盘盈数量")]
    [ExporterHeader("盘盈数量", Format = "", Width = 25, IsBold = true)]
    public int? ProfitQuantity { get; set; }

    /// <summary>
    /// 盘亏数量
    /// </summary>
    [ImporterHeader(Name = "盘亏数量")]
    [ExporterHeader("盘亏数量", Format = "", Width = 25, IsBold = true)]
    public int? LossQuantity { get; set; }

    /// <summary>
    /// 盘盈金额
    /// </summary>
    [ImporterHeader(Name = "盘盈金额")]
    [ExporterHeader("盘盈金额", Format = "", Width = 25, IsBold = true)]
    public decimal? ProfitAmount { get; set; }

    /// <summary>
    /// 盘亏金额
    /// </summary>
    [ImporterHeader(Name = "盘亏金额")]
    [ExporterHeader("盘亏金额", Format = "", Width = 25, IsBold = true)]
    public decimal? LossAmount { get; set; }

    /// <summary>
    /// 单据状态
    /// </summary>
    [ImporterHeader(Name = "*单据状态")]
    [ExporterHeader("*单据状态", Format = "", Width = 25, IsBold = true)]
    public DocumentStatusEnum? DocumentStatus { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }

    /// <summary>
    /// 软删除时间
    /// </summary>
    [ImporterHeader(Name = "软删除时间")]
    [ExporterHeader("软删除时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? DeleteTime { get; set; }

}
